package org.nepu.scr.indexrate.converter.compliancerate.keyperformanceindicator.nozzleandtubingtestpressureparametertable;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.domain.keyindicators.vo.PressureTest;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class InputTerminalConverter implements AttributeConverter<PressureTest, String> {
    @Override
    public String convertToDatabaseColumn(PressureTest keyIndicators) {

        return JSONUtil.toJsonStr(keyIndicators);
    }

    @Override
    public PressureTest convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PressureTest.class);
    }
}
